﻿using Nex_CSharp_Demo.utils;
using RobotPerCeption.Entity;
using RobotPerCeption.ViewModel;
using System.Windows;
using System.Windows.Navigation;

namespace RobotPerCeption
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : Application
    {
        protected override void OnExit(ExitEventArgs e)
        {

            //关闭机器人模式线程
            RoboteModelStatusLinsten.stopThread(RoboteModelStatusLinsten.token, RoboteModelStatusLinsten.cts);
            //关闭机器人坐标系线程池
            int cur_thread_count = ThreadUtils.positonThread.Count;
            int remove_thread_count = ThreadUtils.keyItratorRemove();
            if (cur_thread_count != remove_thread_count)
            {
                MessageBox.Show("关闭机器人坐标系监听失败");

            }
            //保持本地文件目录配置


            //获取上次链接的
            base.OnExit(e);
        }

        protected override void OnStartup(StartupEventArgs e)
        {
            ProjectConfig p = new ProjectConfig();
            p.init();
            base.OnStartup(e);
        }

        protected override void OnLoadCompleted(NavigationEventArgs e)
        {

            Console.WriteLine("the resource has load finished");
            base.OnLoadCompleted(e);
        }
    }

}
